<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use Auth;
use Cache;
use Cookie;
use DB;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Input;
use Log;
use Mail;
use Redirect;
use Reponse;
use View;
use App\Utils;
use App\Tag;
use App\Task;
use App\TasksTags;
Use App\Events\GetPrivilege;
Use Illuminate\Support\Facades\Event;

class PrivilegeController extends Controller
{

	public function promotion()
	{
		$user = Auth::user();
		if ($user->score >= 2000 * 100) {
			if ($user->permission < 8) {
				$user->permission = 8;
				$user->save();
			}
			Event::fire(new GetPrivilege($user, 8));
			return "ok";
		}
		return "You are not prepared.";
	}
}
